package com.bbc.yuntun.common.core.domain;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据库表实体基类
 *
 * @author liac
 * @date 2022/4/6
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "POJO基类")
public abstract class BaseEntity extends Entity {

    /** 主键ID */
    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    protected Long id;

    /** 版本号 */
    @Version
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "版本号")
    protected Integer version;

    /** 0-正常，1-已删除，默认0 */
    @TableLogic
    @Schema(description = "删除标识", allowableValues = {"0", "1"})
    @TableField(fill = FieldFill.INSERT)
    protected Integer delFlag;

}
